﻿using System.ComponentModel.DataAnnotations;
using Foolproof;
using Lari.Configuration;

namespace Lari.Services.ViewModel
{
    public class UserMapModel
    {
        public EmployeeModel EmployeeModel { get; set; }
        public int EmpId { get; set; }

        [Required(ErrorMessage = MessageCode.Generic.RequiredPleaseSelect)]
        public int RoleId { get; set; }
       
        [StringLength(20, ErrorMessage = MessageCode.Generic.LengthExceeded)]
        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        [Display(Name = "User Id")]
        public string UserId
        {
            get;
            set;
        }

        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        [StringLength(20, ErrorMessage = "Must be at least 8 characters long and not more than 20.", MinimumLength = 8)]
        public string Password
        {
            get;
            set;
        }
        
        [Required(ErrorMessage = MessageCode.Generic.ReguiredFldMsg)]
        [StringLength(20, ErrorMessage = "Must be at least 8 characters long and not more than 20.", MinimumLength = 8)]
        [EqualTo("Password", ErrorMessage = "New Passwords must match")]
        public string ConfirmPassword
        {
            get;
            set;
        }

        public bool UserIsMapped { get; set; }
    }
}
